<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});
//前台注册
Route::controller('/home/register','Home\RegisterController');
//前台登录
Route::controller('/home/login','Home\LoginController');
//前台主页
Route::controller('/home/index','Home\IndexController');


/**
 * 后台登录
 */

Route::get('/admin/login','Admin\LoginController@login'); 
Route::post('/admin/dologin','Admin\LoginController@doLogin'); 
//后台路由组'middleware'=>'islogin',
Route::group(['prefix'=>'admin','namespace'=>'Admin'],function(){
	//后台首页显示
	Route::get('index','AdminController@index');
	//后台用户
	Route::resource('users','UsersController');
	//前台用户
	Route::resource('user','UserController');
	//后台退出登录
	Route::get('quit','AdminController@quit');
	//友情链接
	Route::post('upload','linkController@upload');
	Route::resource('link','linkController');
});



